package com.wlz.creational.builders.components;


import com.wlz.creational.builders.cars.Car;

/**
 * @author： wlz
 * @Date 2020/10/14 14:25
 * @description： TODO
 * @version: 1.0
 */
public class TripComputer {

    private Car car;

    public void setCar(Car car) {
        this.car = car;
    }

    public void showFuelLevel() {
        System.out.println("Fuel level: " + car.getFuel());
    }

    public void showStatus() {
        if (this.car.getEngine().isStarted()) {
            System.out.println("Car is started");
        } else {
            System.out.println("Car isn't started");
        }
    }
}
